/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pack;


import java.awt.Color;
import net.useobjects.Circle;
import net.useobjects.Group;
import net.useobjects.Polygon;
import net.useobjects.World;
import net.useobjects.geom.Position;
import net.useobjects.keyboard.KeyboardAdapter;
import net.useobjects.keyboard.KeyboardEvent;

public class Strelec extends ValidaciaPremiestnenia {
	
    private Circle postava;
    private Polygon zbran;
    private Strelec strelec;
    private int ax,ay,bx,by,cx,cy;
	
    public Strelec(World svet, Controller controller, Group skupina, Position pozicia, double angle) {
            
        super(skupina,pozicia,angle);
        bx=0;
        by=-10;
        postava = new Circle(this,0,0,10,Color.red);
        zbran = new Polygon(this, 0, -10, Color.black, true, 5,0, bx,by, -5,0);
        strelec = this;
        
        
        KeyboardAdapter keyboardAdapter = new KeyboardAdapter() {

            @Override
            public void onKeyPressed(KeyboardEvent ke) {
                controller.performAction(strelec);
            }
        };
    
        svet.addKeyboardListener(keyboardAdapter);
    
    }
    
    double getPolarRadius(Position position) {
        return super.getPolarRadius(position);
    }
    

    
    Circle getCircle() {
        return postava;
    }
    
    Polygon getPolygon() {
        return zbran;
    }
    
}